home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / winlib.lzh / WINLIB / TEST.C < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-04  |  30.6 KB  |  1,153 lines

  1. /********************************************************************
  2.  *                                                                    *
  3.  *    WinLIB PRO 0.64A                                                *
  4.  *    Test program                                                    *
  5.  *                                                                    *
  6.  *    Copyright (C) 1993 - 1994, Clever Bits and Bitgate Software.    *
  7.  *    All rights reserved.                                            *
  8.  *                                                                    *
  9.  *    The main demonstration program.  Although we try to demonstrate    *
  10.  *    all of the useful functions of WinLIB PRO, we cannot assure        *
  11.  *    that the entire functionality will be displayed.                *
  12.  *                                                                    *
  13.  ********************************************************************
  14.  *                                                                    *
  15.  *    Update log:                                                        *
  16.  *                                                                    *
  17.  *    [12.11.93 - 29.3.94] Ken Hollis                                    *
  18.  *        TextDispatchers        - removed, added version info and fixed    *
  19.  *                              some routines                            *
  20.  *        AboutDispatcher        - changed the about boxes to NAME|MOVER    *
  21.  *                              since it doesn't make sense to have it*
  22.  *                              closable or fullable since it IS MODAL*
  23.  *        EtcDispatcher        - added resource stuff, sliders, and    *
  24.  *                              popups; looks better now.                *
  25.  *                            - added MN_SELECTED (sideroot) items    *
  26.  *                            - added accessory calling routine        *
  27.  *        DlgDispatchers        - fixed some incoherence                *
  28.  *                            - added slider routines                    *
  29.  *                            - added slider counter stuff            *
  30.  *                            - added popup object display            *
  31.  *                            - fixed popup selection display stuff    *
  32.  *        WndDispatcher        - added timer message (removed timer    *
  33.  *                                dispatchers; it was a waste)        *
  34.  *                            - added task switching management        *
  35.  *        [resource]            - fixed resource file up a bit            *
  36.  *                            - added resource info section            *
  37.  *                            - added key equivalents for all dialogs *
  38.  *                            - added size check in Dialog 4            *
  39.  *                            - popups and sliders are now drawn in 3D*
  40.  *        [global]            - added dominance settings to all wins    *
  41.  *                                                                    *
  42.  ********************************************************************/
  43.  
  44. #include "winlib.h"
  45. #include "nkcc.h"
  46. #include <vdi.h>
  47. #include <stddef.h>
  48. #include <stdio.h>
  49. #include <tos.h>
  50. #include <ext.h>
  51.  
  52. #include "test.h"
  53.  
  54. #define RSCFILE "TEST.RSC"
  55. #define    __DEMO__ "** RELEASE THIS AND DIE! **"
  56.  
  57. GLOBAL int Dlg6Dispatcher(WINDOW *win, int msg_buf[]);
  58.  
  59. int handle, ap_id, acc_id, AEShandle;
  60. OBJECT *menubar;
  61.  
  62. char *ColIndex[] =
  63. { " ", " ", "White", "Black", "Red", "Green", "Blue", "Cyan", "Yellow", "Magenta" };
  64.  
  65. int wind1parms = 5, wind2parms = 1;
  66. int timecount = 0;
  67.  
  68. int WindowDispatcher(WINDOW *win, int msg_buf[8])
  69. {
  70.     int pxyarray[4];
  71.     GRECT own, temp;
  72.  
  73.     switch (*msg_buf) {
  74.         case WM_CREATED:
  75.             win->menubar[ENABONE].ob_state |= DISABLED;
  76.             win->menubar[RESUONE].ob_state |= DISABLED;
  77.             win->menubar[ENABALL].ob_state |= DISABLED;
  78.             win->menubar[RESUALL].ob_state |= DISABLED;
  79.  
  80.             WCreateTimer(win, T_RUNNING, 500, &wind1parms);
  81.             return TRUE;
  82.  
  83.         case WM_KILL:
  84.             WStopTimer(win);
  85.             break;
  86.  
  87.         case WM_TIMER:
  88.             {
  89.                 int x, y, w, h;
  90.  
  91.                 if (num_colors >= 256) {
  92.                     (*(int *) (win->user))++;
  93.                     if ((*(int *) (win->user) >= 255))
  94.                         (*(int *) (win->user)) = 0;
  95.                 } else if (num_colors > 4) {
  96.                     (*(int *) (win->user))++;
  97.                     if ((*(int *) (win->user) >= 15))
  98.                         (*(int *) (win->user)) = 0;
  99.                 } else if (num_colors > 2) {
  100.                     (*(int *) (win->user))++;
  101.                     (*(int *) (win->user)) &= 0x3;
  102.                 } else {
  103.                     (*(int *) (win->user))++;
  104.                     (*(int *) (win->user)) &= 0x1;
  105.                 }
  106.  
  107.                 WWindGet(win, WF_WORKXYWH, &x, &y, &w, &h);
  108.                 WRedrawWindow(win, x, y, w, h);    
  109.             }
  110.  
  111.             return TRUE;
  112.  
  113.         case WM_TIMECHG:
  114.             switch(msg_buf[4]) {
  115.                 case T_RUNNING:
  116.                     win->menubar[ENABONE].ob_state |= DISABLED;
  117.                     win->menubar[RESUONE].ob_state |= DISABLED;
  118.                     win->menubar[STOPONE].ob_state &= ~DISABLED;
  119.                     win->menubar[PAUSONE].ob_state &= ~DISABLED;
  120.                     return TRUE;
  121.  
  122.                 case T_STOPPED:
  123.                     win->menubar[ENABONE].ob_state &= ~DISABLED;
  124.                     win->menubar[RESUONE].ob_state &= ~DISABLED;
  125.                     win->menubar[STOPONE].ob_state |= DISABLED;
  126.                     win->menubar[PAUSONE].ob_state |= DISABLED;
  127.                     return TRUE;
  128.  
  129.                 case T_ALLSTOP:
  130.                 case T_ALLRUN:
  131.                     return TRUE;
  132.             }
  133.  
  134.             return TRUE;
  135.  
  136.         case MN_SELECTED:
  137.             switch (msg_buf[4]) {
  138.                 case ENABONE:
  139.                 case RESUONE:
  140.                     WStartTimer(win);
  141.                     return FALSE;
  142.  
  143.                 case STOPONE:
  144.                 case PAUSONE:
  145.                     WStopTimer(win);
  146.                     return FALSE;
  147.             }
  148.  
  149.             return FALSE;
  150.  
  151.         case WM_CLOSED:
  152.             if (msg_buf[4] == WC_OBJECTABLE) {
  153.                 int i;
  154.  
  155.                 i = WFormCustAlert(1, " Multitasking Timer ",
  156.                     "Closing this window will stop",
  157.                     "the multitasking timer",
  158.                     "display.  Do you really wish",
  159.                     "to do this?",
  160.                     " ", "[Okay", " ", "C[ancel");
  161.  
  162.                 if (i == 1)
  163.                     WCloseWindow(win, WC_NOTOBJECTABLE);
  164.                 else
  165.                     return TRUE;
  166.             } else return FALSE;
  167.  
  168.         case WM_REDRAW:
  169.             wind_update(BEG_UPDATE);
  170.             graf_mouse(M_OFF, NULL);
  171.  
  172.             vswr_mode(handle, MD_REPLACE);
  173.             vsf_color(handle, *(int *) win->user);
  174.  
  175.             own.g_x = msg_buf[4];
  176.             own.g_y = msg_buf[5];
  177.             own.g_w = msg_buf[6];
  178.             own.g_h = msg_buf[7];
  179.  
  180.             WWindGet(win, WF_FIRSTXYWH, &temp.g_x, &temp.g_y, &temp.g_w, &temp.g_h);
  181.             while (temp.g_w && temp.g_h)
  182.             {
  183.                 if (rc_intersect(&temp, &own))
  184.                 {
  185.                     pxyarray[0] = temp.g_x;
  186.                     pxyarray[1] = temp.g_y;
  187.                     pxyarray[2] = temp.g_x + temp.g_w - 1;
  188.                     pxyarray[3] = temp.g_y + temp.g_h - 1;
  189.  
  190.                     v_bar(handle, pxyarray);
  191.                 }
  192.                 WWindGet(win, WF_NEXTXYWH, &temp.g_x, &temp.g_y, &temp.g_w, &temp.g_h);
  193.             }
  194.  
  195.             graf_mouse(M_ON, NULL);
  196.             wind_update(END_UPDATE);
  197.  
  198.             return TRUE;
  199.     }
  200.  
  201.     return FALSE;
  202. }
  203.  
  204. int Window2Dispatcher(WINDOW *win, int msg_buf[8])
  205. {
  206.     int pxyarray[4];
  207.     GRECT own, temp;
  208.  
  209.     switch (*msg_buf) {
  210.         case WM_CREATED:
  211.             win->menubar[ENABONE].ob_state |= DISABLED;
  212.             win->menubar[RESUONE].ob_state |= DISABLED;
  213.             win->menubar[ENABALL].ob_state |= DISABLED;
  214.             win->menubar[RESUALL].ob_state |= DISABLED;
  215.  
  216.             ChangeObjectText(win->tree, TCCOUNT, "0", 3, TE_RIGHT);
  217.             ChangeObjectText(win->tree, TDISP, "Timer version 0.01", 3, TE_CNTR);
  218.  
  219.             WCreateTimer(win, T_RUNNING, 1000, 0);
  220.             return TRUE;
  221.  
  222.         case WM_KILL:
  223.             WStopTimer(win);
  224.             break;
  225.  
  226.         case WM_TIMER:
  227.             {
  228.                 int x, y;
  229.                 char *cnt;
  230.  
  231.                 timecount++;
  232.  
  233.                 sprintf(cnt, "%d", timecount);
  234.                 ChangeObjectText(win->tree, TCCOUNT, cnt, 3, TE_RIGHT);
  235.  
  236.                 objc_offset(win->tree, TCCOUNT, &x, &y);
  237.                 WRedrawWindow(win, x, y, win->tree[TCCOUNT].ob_width, win->tree[TCCOUNT].ob_height);
  238.             }
  239.             return TRUE;
  240.  
  241.         case WM_TIMECHG:
  242.             switch(msg_buf[4]) {
  243.                 case T_RUNNING:
  244.                     win->menubar[ENABONE].ob_state |= DISABLED;
  245.                     win->menubar[RESUONE].ob_state |= DISABLED;
  246.                     win->menubar[STOPONE].ob_state &= ~DISABLED;
  247.                     win->menubar[PAUSONE].ob_state &= ~DISABLED;
  248.                     return TRUE;
  249.  
  250.                 case T_STOPPED:
  251.                     win->menubar[ENABONE].ob_state &= ~DISABLED;
  252.                     win->menubar[RESUONE].ob_state &= ~DISABLED;
  253.                     win->menubar[STOPONE].ob_state |= DISABLED;
  254.                     win->menubar[PAUSONE].ob_state |= DISABLED;
  255.                     return TRUE;
  256.  
  257.                 case T_ALLSTOP:
  258.                 case T_ALLRUN:
  259.                     return TRUE;
  260.             }
  261.  
  262.             return TRUE;
  263.  
  264.         case MN_SELECTED:
  265.             switch (msg_buf[4]) {
  266.                 case ENABONE:
  267.                 case RESUONE:
  268.                     WStartTimer(win);
  269.                     return FALSE;
  270.  
  271.                 case STOPONE:
  272.                 case PAUSONE:
  273.                     WStopTimer(win);
  274.                     return FALSE;
  275.             }
  276.  
  277.             return FALSE;
  278.  
  279.         case WM_CLOSED:
  280.             if (msg_buf[4] == WC_OBJECTABLE) {
  281.                 int i;
  282.  
  283.                 i = WFormCustAlert(1, " Multitasking Timer ",
  284.                     "Closing this window will stop",
  285.                     "the multitasking timer",
  286.                     "display.  Do you really wish",
  287.                     "to do this?",
  288.                     " ", "[Okay", " ", "C[ancel");
  289.  
  290.                 if (i == 1)
  291.                     WCloseWindow(win, WC_NOTOBJECTABLE);
  292.                 else
  293.                     return TRUE;
  294.             } else return FALSE;
  295.     }
  296.  
  297.     return FALSE;
  298. }
  299.  
  300. int TextDispatcher(WINDOW *win, int msg_buf[8])
  301. {
  302.     return FALSE;
  303. }
  304.  
  305. int ToolDispatcher(WINDOW *win, int msg_buf[8])
  306. {
  307.     switch(*msg_buf) {
  308.         case WM_CLOSED:
  309.             if (msg_buf[4] == WC_OBJECTABLE)
  310.                 WFormCustAlert(1, " Toolbar ",
  311.                                 "Sorry, the toolbar cannot be",
  312.                                 "closed.",
  313.                                 "", "", "", " ", "[Okay", " ");
  314.             return TRUE;
  315.  
  316.         case WM_ICONIFIED:
  317.             WFormCustAlert(1, " Toolbar ",
  318.                             "Sorry, the toolbar cannot be",
  319.                             "iconified yet.",
  320.                             "", "", "", " ", "[Okay", " ");
  321.             return TRUE;
  322.  
  323.         case WM_DIALOG:
  324.             switch(msg_buf[3]) {
  325.                 case SAVE1:
  326.                 case SAVE2:
  327.                 case SAVE3:
  328.                 case LOAD1:
  329.                 case LOAD2:
  330.                 case LOAD3:
  331.                     WFormCustAlert(1, " Toolbar ",
  332.                                     "Sorry, this is only a demo",
  333.                                     "therefore, the toolbar is",
  334.                                     "not actually functional.",
  335.                                     "It is just to show how",
  336.                                     "WinLIB PRO can use one.", " ", "[Okay", " ");
  337.                     return FALSE;
  338.             }
  339.     }
  340.  
  341.     return FALSE;
  342. }
  343.  
  344. int AboutDispatcher(WINDOW *win, int msg_buf[8])
  345. {
  346.     OBJECT *ptr;
  347.  
  348.     switch (*msg_buf) {
  349.         case WM_CREATED:
  350.             rsrc_gaddr(R_TREE, MENU2, &ptr);
  351.             return FALSE;
  352.  
  353.         case WM_KILL:
  354.             rsrc_gaddr(R_TREE, MENU2, &ptr);
  355.             return FALSE;
  356.         
  357.         case WM_DIALOG:
  358.             switch(msg_buf[3]) {
  359.                 case OKBOX:        WCloseWindow(win, WC_NOTOBJECTABLE);
  360.                                 return TRUE;
  361.                 case INFOBOX:    WCloseWindow(win, WC_NOTOBJECTABLE);
  362.                                 WCreateWindow(W_TEXTWIN, 0, W_TEXT_ATTRIBUTES, "WinLIB PRO Version Info", NULL,
  363.                                                 -1, 0, -1,
  364.                                                 TextDispatcher, 0,
  365.                                                 30, 50, 150, 100, NULL, D_SWITCHABLE);
  366.                                 return TRUE;
  367.             }
  368.  
  369.     }
  370.  
  371.     return FALSE;
  372. }
  373.  
  374.  
  375. int ResourceDispatcher(WINDOW *win, int msg_buf[8])
  376. {
  377.     switch (*msg_buf) {
  378.         case WM_CREATED:
  379.             return FALSE;
  380.  
  381.         case WM_KILL:
  382.             return FALSE;
  383.     }
  384.  
  385.     return FALSE;
  386. }
  387.  
  388.  
  389. int Dlg1Dispatcher(WINDOW *win, int msg_buf[8])
  390. {
  391.     switch (*msg_buf) {
  392.         case WM_CREATED:
  393.             break;
  394.  
  395.         case WM_DIALOG:
  396.             switch (msg_buf[3]) {
  397.                 case OKBUTTON:
  398.                     objc_change(win->tree, OKBUTTON, 0, 0, 0, 0, 0, NORMAL, 0);
  399.                     WCloseWindow(win, WC_NOTOBJECTABLE);
  400.                     return TRUE;
  401.             }
  402.             break;
  403.  
  404.         case MN_SELECTED:
  405.             switch (msg_buf[4]) {
  406.                 case QUIT_M2:
  407.                     WCloseWindow(win, WC_OBJECTABLE);
  408.                     return FALSE;
  409.         
  410.                 case ABOUT_M2:
  411.                     WCreateWindow(W_DIALOGICON | W_UNUNTOPPABLE, 0, NAME|INFO|MOVER|FULLER, "About me...", NULL,
  412.                                     ABOUTME, 0, -1,
  413.                                     AboutDispatcher,
  414.                                     0,
  415.                                     -1, -1, -1, -1, NULL, D_SWITCHABLE);
  416.                     return FALSE;
  417.             }
  418.             break;
  419.     }
  420.  
  421.     return FALSE;
  422. }
  423.  
  424.  
  425. int Dlg2Dispatcher(WINDOW *win, int msg_buf[8])
  426. {
  427.     switch (*msg_buf) {
  428.         case WM_CREATED:
  429.             return FALSE;
  430.  
  431.         case WM_KILL:
  432.             return FALSE;
  433.  
  434.         case WM_DIALOG:
  435.             switch (msg_buf[3])
  436.             {
  437.                 case EXITER:
  438.                     objc_change(win->tree, EXITER, 0, 0, 0, 0, 0, NORMAL, 0);
  439.                     WCloseWindow(win, WC_NOTOBJECTABLE);
  440.                     return TRUE;
  441.             }
  442.             break;
  443.  
  444.         case MN_SELECTED:
  445.             switch (msg_buf[4]) {
  446.                 case QUIT_M2:
  447.                     WCloseWindow(win, WC_OBJECTABLE);
  448.                     return FALSE;
  449.         
  450.                 case ABOUT_M2:
  451.                     WCreateWindow(W_DIALOGICON | W_UNUNTOPPABLE, 0, NAME|MOVER|INFO|FULLER, "About me...", " Copyright \275 1992 - 1994",
  452.                                     ABOUTME, 0, -1,
  453.                                     AboutDispatcher,
  454.                                     0,
  455.                                     -1, -1, -1, -1, NULL, D_SWITCHABLE);
  456.                     return FALSE;
  457.             }
  458.             break;
  459.     }
  460.  
  461.     return FALSE;
  462. }
  463.  
  464.  
  465. int Dlg3Dispatcher(WINDOW *win, int msg_buf[8])
  466. {
  467.     switch (*msg_buf) {
  468.         case WM_CREATED:
  469.             return FALSE;
  470.  
  471.         case WM_KILL:
  472.             return FALSE;
  473.  
  474.         case WM_DIALOG:
  475.             {
  476.                 OBJECT *p_up;
  477.                 int tm;
  478.  
  479.                 rsrc_gaddr(R_TREE, POPUP, &p_up);
  480.  
  481.                 switch (msg_buf[3]) {
  482.                     case PU1:
  483.                     case CYCLE1:
  484.                         PDropdown_WinXY(win, PU1, p_up);
  485.                         tm = PDoPopup(win, POPUP, menubar, FALSE, win->tree[PU1].ob_x, win->tree[PU1].ob_y, win->tree[PU1].ob_width, win->tree[PU1].ob_height);
  486.                         if (tm>0) {
  487.                             win->popups[1] = tm;
  488.                             ChangeObjectText(win->tree, PU1, ColIndex[win->popups[1]], 3, TE_CNTR);
  489.                             WObjc_Draw(win->tree, PU1, 1, desk.g_x, desk.g_y, desk.g_w, desk.g_h);
  490.                         }
  491.                         return FALSE;
  492.  
  493.                     case PU2:
  494.                     case CYCLE2:
  495.                         PDropdown_WinXY(win, PU2, p_up);
  496.                         tm = PDoPopup(win, POPUP, menubar, FALSE, win->tree[PU2].ob_x, win->tree[PU2].ob_y, win->tree[PU2].ob_width, win->tree[PU2].ob_height);
  497.                         if (tm>0) {
  498.                             win->popups[2] = tm;
  499.                             ChangeObjectText(win->tree, PU2, ColIndex[win->popups[2]], 3, TE_CNTR);
  500.                             WObjc_Draw(win->tree, PU2, 1, desk.g_x, desk.g_y, desk.g_w, desk.g_h);
  501.                         }
  502.                         return FALSE;
  503.  
  504.                     case PU3:
  505.                     case CYCLE3:
  506.                         PDropdown_WinXY(win, PU3, p_up);
  507.                         tm = PDoPopup(win, POPUP, menubar, FALSE, win->tree[PU3].ob_x, win->tree[PU3].ob_y, win->tree[PU3].ob_width, win->tree[PU3].ob_height);
  508.                         if (tm>0) {
  509.                             win->popups[3] = tm;
  510.                             ChangeObjectText(win->tree, PU3, ColIndex[win->popups[3]], 3, TE_CNTR);
  511.                             WObjc_Draw(win->tree, PU3, 1, desk.g_x, desk.g_y, desk.g_w, desk.g_h);
  512.                         }
  513.                         return FALSE;
  514.  
  515.                     case PU4:
  516.                     case CYCLE4:
  517.                         PDropdown_WinXY(win, PU4, p_up);
  518.                         tm = PDoPopup(win, POPUP, menubar, FALSE, win->tree[PU4].ob_x, win->tree[PU4].ob_y, win->tree[PU4].ob_width, win->tree[PU4].ob_height);
  519.                         if (tm>0) {
  520.                             win->popups[4] = tm;
  521.                             ChangeObjectText(win->tree, PU4, ColIndex[win->popups[4]], 3, TE_CNTR);
  522.                             WObjc_Draw(win->tree, PU4, 1, desk.g_x, desk.g_y, desk.g_w, desk.g_h);
  523.                         }
  524.                         return FALSE;
  525.  
  526.                     case PU5:
  527.                     case CYCLE5:
  528.                         PDropdown_WinXY(win, PU5, p_up);
  529.                         tm = PDoPopup(win, POPUP, menubar, FALSE, win->tree[PU5].ob_x, win->tree[PU5].ob_y, win->tree[PU5].ob_width, win->tree[PU5].ob_height);
  530.                         if (tm>0) {
  531.                             win->popups[5] = tm;
  532.                             ChangeObjectText(win->tree, PU5, ColIndex[win->popups[5]], 3, TE_CNTR);
  533.                             WObjc_Draw(win->tree, PU5, 1, desk.g_x, desk.g_y, desk.g_w, desk.g_h);
  534.                         }
  535.                         return FALSE;
  536.  
  537.                     case PU6:
  538.                     case CYCLE6:
  539.                         PDropdown_WinXY(win, PU6, p_up);
  540.                         tm = PDoPopup(win, POPUP, menubar, FALSE, win->tree[PU6].ob_x, win->tree[PU6].ob_y, win->tree[PU6].ob_width, win->tree[PU6].ob_height);
  541.                         if (tm>0) {
  542.                             win->popups[6] = tm;
  543.                             ChangeObjectText(win->tree, PU6, ColIndex[win->popups[6]], 3, TE_CNTR);
  544.                             WObjc_Draw(win->tree, PU6, 1, desk.g_x, desk.g_y, desk.g_w, desk.g_h);
  545.                         }
  546.                         return FALSE;
  547.  
  548.                     case PU7:
  549.                     case CYCLE7:
  550.                         PDropdown_WinXY(win, PU7, p_up);
  551.                         tm = PDoPopup(win, POPUP, menubar, FALSE, win->tree[PU7].ob_x, win->tree[PU7].ob_y, win->tree[PU7].ob_width, win->tree[PU7].ob_height);
  552.                         if (tm>0) {
  553.                             win->popups[7] = tm;
  554.                             ChangeObjectText(win->tree, PU7, ColIndex[win->popups[7]], 3, TE_CNTR);
  555.                             WObjc_Draw(win->tree, PU7, 1, desk.g_x, desk.g_y, desk.g_w, desk.g_h);
  556.                         }
  557.                         return FALSE;
  558.  
  559.                     case PU8:
  560.                     case CYCLE8:
  561.                         PDropdown_WinXY(win, PU8, p_up);
  562.                         tm = PDoPopup(win, POPUP, menubar, FALSE, win->tree[PU8].ob_x, win->tree[PU8].ob_y, win->tree[PU8].ob_width, win->tree[PU8].ob_height);
  563.                         if (tm>0) {
  564.                             win->popups[8] = tm;
  565.                             ChangeObjectText(win->tree, PU8, ColIndex[win->popups[8]], 3, TE_CNTR);
  566.                             WObjc_Draw(win->tree, PU8, 1, desk.g_x, desk.g_y, desk.g_w, desk.g_h);
  567.                         }
  568.                         return FALSE;
  569.  
  570.                     case PU9:
  571.                     case CYCLE9:
  572.                         PDropdown_WinXY(win, PU9, p_up);
  573.                         tm = PDoPopup(win, POPUP, menubar, FALSE, win->tree[PU9].ob_x, win->tree[PU9].ob_y, win->tree[PU9].ob_width, win->tree[PU9].ob_height);
  574.                         if (tm>0) {
  575.                             win->popups[9] = tm;
  576.                             ChangeObjectText(win->tree, PU9, ColIndex[win->popups[9]], 3, TE_CNTR);
  577.                             WObjc_Draw(win->tree, PU9, 1, desk.g_x, desk.g_y, desk.g_w, desk.g_h);
  578.                         }
  579.                         return FALSE;
  580.  
  581.                     case PU10:
  582.                     case CYCLE10:
  583.                         PDropdown_WinXY(win, PU10, p_up);
  584.                         tm = PDoPopup(win, POPUP, menubar, FALSE, win->tree[PU10].ob_x, win->tree[PU10].ob_y, win->tree[PU10].ob_width, win->tree[PU10].ob_height);
  585.                         if (tm>0) {
  586.                             win->popups[10] = tm;
  587.                             ChangeObjectText(win->tree, PU10, ColIndex[win->popups[10]], 3, TE_CNTR);
  588.                             WObjc_Draw(win->tree, PU10, 1, desk.g_x, desk.g_y, desk.g_w, desk.g_h);
  589.                         }
  590.                         return FALSE;
  591.  
  592.                     case PU11:
  593.                     case CYCLE11:
  594.                         PDropdown_WinXY(win, PU11, p_up);
  595.                         tm = PDoPopup(win, POPUP, menubar, FALSE, win->tree[PU11].ob_x, win->tree[PU11].ob_y, win->tree[PU11].ob_width, win->tree[PU11].ob_height);
  596.                         if (tm>0) {
  597.                             win->popups[11] = tm;
  598.                             ChangeObjectText(win->tree, PU11, ColIndex[win->popups[11]], 3, TE_CNTR);
  599.                             WObjc_Draw(win->tree, PU11, 1, desk.g_x, desk.g_y, desk.g_w, desk.g_h);
  600.                         }
  601.                         return FALSE;
  602.  
  603.                     case PU12:
  604.                     case CYCLE12:
  605.                         PDropdown_WinXY(win, PU12, p_up);
  606.                         tm = PDoPopup(win, POPUP, menubar, FALSE, win->tree[PU12].ob_x, win->tree[PU12].ob_y, win->tree[PU12].ob_width, win->tree[PU12].ob_height);
  607.                         if (tm>0) {
  608.                             win->popups[12] = tm;
  609.                             ChangeObjectText(win->tree, PU12, ColIndex[win->popups[12]], 3, TE_CNTR);
  610.                             WObjc_Draw(win->tree, PU12, 1, desk.g_x, desk.g_y, desk.g_w, desk.g_h);
  611.                         }
  612.                         return FALSE;
  613.                 }
  614.             }
  615.  
  616.         case MN_SELECTED:
  617.             switch (msg_buf[4]) {
  618.                 case QUIT_M2:
  619.                     WCloseWindow(win, WC_OBJECTABLE);
  620.                     return FALSE;
  621.         
  622.                 case ABOUT_M2:
  623.                     WCreateWindow(W_DIALOGICON | W_UNUNTOPPABLE, 0, NAME|MOVER|INFO|FULLER, "About me...", " Copyright \275 1992 - 1994",
  624.                                     ABOUTME, 0, -1,
  625.                                     AboutDispatcher,
  626.                                     0,
  627.                                     -1, -1, -1, -1, NULL, D_SWITCHABLE);
  628.                     return FALSE;
  629.             }
  630.             break;
  631.     }
  632.  
  633.     return FALSE;
  634. }
  635.  
  636.  
  637. int Dlg4Dispatcher(WINDOW *win, int msg_buf[8])
  638. {
  639.     switch (*msg_buf) {
  640.         case WM_CREATED:
  641.             HorizontalSlideReset(win, 1, 100, 0, HORTRK1, HORSL1,
  642.                                 HORSL1, 0);
  643.             HorizontalSlideReset(win, 2, 100, 0, HORTRK2, HORSL2,
  644.                                 HORSL2, 0);
  645.             HorizontalSlideReset(win, 5, 100, 0, HORTRK3, HORSL3,
  646.                                 HORSL3, 0);
  647.             HorizontalSlideReset(win, 6, 100, 0, HORTRK4, HORSL4,
  648.                                 HORSL4, 0);
  649.             VerticalSlideReset(win, 3, 100, 0, VERTSL1, VERTTRK1,
  650.                                 VERTSL1, 0);
  651.             VerticalSlideReset(win, 4, 100, 0, VERTSL2, VERTTRK2,
  652.                                 VERTSL2, 0);
  653.             return FALSE;
  654.  
  655.         case WM_KILL:
  656.             return FALSE;
  657.  
  658.         case WM_DIALOG:
  659.             switch(msg_buf[3]) {
  660.                 case HORLT1:
  661.                 case HORRT1:
  662.                 case HORSL1:
  663.                 case HORTRK1:
  664.                     DoHorizontalSlide(win, 1, HORTRK1, HORSL1,
  665.                                     HORLT1, HORRT1, msg_buf[3],
  666.                                     5, HORSL1);
  667.                     return FALSE;
  668.  
  669.                 case HORLT2:
  670.                 case HORRT2:
  671.                 case HORSL2:
  672.                 case HORTRK2:
  673.                     DoHorizontalSlide(win, 2, HORTRK2, HORSL2,
  674.                                     HORLT2, HORRT2, msg_buf[3],
  675.                                     5, HORSL2);
  676.                     return FALSE;
  677.  
  678.                 case HORLT3:
  679.                 case HORRT3:
  680.                 case HORSL3:
  681.                 case HORTRK3:
  682.                     DoHorizontalSlide(win, 5, HORTRK3, HORSL3,
  683.                                     HORLT3, HORRT3, msg_buf[3],
  684.                                     5, HORSL3);
  685.                     return FALSE;
  686.  
  687.                 case HORLT4:
  688.                 case HORRT4:
  689.                 case HORSL4:
  690.                 case HORTRK4:
  691.                     DoHorizontalSlide(win, 6, HORTRK4, HORSL4,
  692.                                     HORLT4, HORRT4, msg_buf[3],
  693.                                     5, HORSL4);
  694.                     return FALSE;
  695.  
  696.                 case VERTTRK1:
  697.                 case VERTUP1:
  698.                 case VERTDN1:
  699.                 case VERTSL1:
  700.                     DoVerticalSlide(win, 3, VERTTRK1, VERTSL1,
  701.                                     VERTUP1, VERTDN1, msg_buf[3],
  702.                                     5, VERTSL1);
  703.                     return FALSE;
  704.  
  705.                 case VERTTRK2:
  706.                 case VERTUP2:
  707.                 case VERTDN2:
  708.                 case VERTSL2:
  709.                     DoVerticalSlide(win, 4, VERTTRK2, VERTSL2,
  710.                                     VERTUP2, VERTDN2, msg_buf[3],
  711.                                     5, VERTSL2);
  712.                     return FALSE;
  713.             }
  714.             break;
  715.  
  716.         case MN_SELECTED:
  717.             switch (msg_buf[4]) {
  718.                 case QUIT_M2:
  719.                     WCloseWindow(win, WC_OBJECTABLE);
  720.                     return FALSE;
  721.         
  722.                 case ABOUT_M2:
  723.                     WCreateWindow(W_DIALOGICON | W_UNUNTOPPABLE, 0, NAME|MOVER|INFO|FULLER, "About me...", " Copyright \275 1992 - 1994",
  724.                                     ABOUTME, 0, -1,
  725.                                     AboutDispatcher,
  726.                                     0,
  727.                                     -1, -1, -1, -1, NULL, D_SWITCHABLE);
  728.                     return FALSE;
  729.             }
  730.             break;
  731.     }
  732.  
  733.     return FALSE;
  734. }
  735.  
  736. int Dlg5Dispatcher(WINDOW *win, int msg_buf[8])
  737. {
  738.     switch (*msg_buf) {
  739.         case WM_KILL:
  740.             return FALSE;
  741.     }
  742.  
  743.     return FALSE;
  744. }
  745.  
  746. int KeyDispatcher(int key)
  747. {
  748.     if ((key & NKF_CTRL) && (key & NKF_ALT)) {
  749.         switch (key & 0xFF) {
  750.             case NK_F1:    
  751.                 WCreateWindow(W_TEXTWIN, 0, W_TEXT_ATTRIBUTES, "WinLIB PRO Version Info", NULL,
  752.                                 -1, 0, -1,
  753.                                 TextDispatcher, 0,
  754.                                 30, 50, 150, 100, NULL, D_SWITCHABLE);
  755.                 return TRUE;
  756.         }
  757.     } else {
  758.         if (key & NKF_CTRL)
  759.             switch (key & 0xff) {
  760.                 case 'u':
  761.                 case 'U':
  762.                     WCloseWindow(NULL, WC_OBJECTABLE);
  763.                     return TRUE;
  764.  
  765.                 case 'w':
  766.                 case 'W':
  767.                     WTopWindow(NULL);
  768.                     return TRUE;
  769.  
  770.                 case 'q':
  771.                 case 'Q':
  772.                     if (_app)
  773.                         WDie(0);    /* Close windows and die */
  774.                     return TRUE;
  775.  
  776.                 case 'i':
  777.                 case 'I':
  778.                     if (!WFindWindow(ABOUTME))
  779.                         WCreateWindow( W_DIALOGICON | W_UNUNTOPPABLE, 0, NAME|MOVER|INFO|FULLER, "About me...", " Copyright \275 1992 - 1994",
  780.                                         ABOUTME, 0, -1,
  781.                                         AboutDispatcher,
  782.                                         0,
  783.                                         -1, -1, -1, -1, NULL, D_SWITCHABLE);
  784.                     return TRUE;
  785.  
  786.                 case 'r':
  787.                 case 'R':
  788.                     if (!WFindWindow(RSCINFO))
  789.                         WCreateWindow(W_DIALOGICON | W_UNUNTOPPABLE, 0, NAME|MOVER|FULLER, "Resource info...", NULL,
  790.                                         RSCINFO, 0, -1,
  791.                                         ResourceDispatcher,
  792.                                         0,
  793.                                         -1, -1, -1, -1, NULL, D_SWITCHABLE);
  794.                     return TRUE;
  795.  
  796.                 case NK_F1:
  797.                     WCreateWindow(W_TIMER | W_OPEN | W_FULLERICONIFIES, 0, NAME|CLOSER|SIZER|MOVER|FULLER, "Window 1", NULL,
  798.                                     -1, 0, MENU3,
  799.                                     WindowDispatcher,
  800.                                     &wind1parms,
  801.                                     10, 20, 200, 40, NULL, D_NONE);
  802.                     return TRUE;
  803.  
  804.                 case NK_F2:
  805.                     WCreateWindow(W_DIALOGICON, S_MULTICOPYABLE, NAME|CLOSER|MOVER|FULLER, "Dialog 1", NULL,
  806.                                     DIALOG1, EDITABLE1, MENU2,
  807.                                     Dlg1Dispatcher,
  808.                                     0,
  809.                                     10, -1, -1, -1, NULL, D_NONE);
  810.                     return TRUE;
  811.  
  812.                 case NK_F3:
  813.                     if (!WFindWindow(DIALOG2))
  814.                         WCreateWindow(W_DIALOGICON, 0, NAME|CLOSER|MOVER|FULLER, "Dialog 2", NULL,
  815.                                         DIALOG2, EDITME, MENU2,
  816.                                         Dlg2Dispatcher,
  817.                                         0,
  818.                                         -1, -1, -1, -1, NULL, D_NONE);
  819.                     return TRUE;
  820.  
  821.                 case NK_F4:
  822.                     if (!WFindWindow(DIALOG3))
  823.                         WCreateWindow(W_DIALOGICON, 0, NAME|CLOSER|MOVER|FULLER, "Dialog 3", NULL,
  824.                                         DIALOG3, 0, MENU2,
  825.                                         Dlg3Dispatcher,
  826.                                         0,
  827.                                         -1, -1, -1, -1, NULL, D_NONE);
  828.                     return TRUE;
  829.  
  830.                 case NK_F5:
  831.                     if (!WFindWindow(DIALOG4))
  832.                         WCreateWindow(W_DIALOGICON, 0, NAME|CLOSER|MOVER|FULLER, "Dialog 4", NULL,
  833.                                         DIALOG4, 0, MENU2,
  834.                                         Dlg4Dispatcher,
  835.                                         0,
  836.                                         -1, -1, -1, -1, NULL, D_NONE);
  837.                     return TRUE;
  838.  
  839.                 case NK_F6:
  840.                     if (!WFindWindow(DIALOG5))
  841.                         WCreateWindow(W_DIALOGICON, 0, NAME|CLOSER|MOVER, "Help window", NULL,
  842.                                         DIALOG5, 0, -1,
  843.                                         Dlg6Dispatcher,
  844.                                         0,
  845.                                         -1, -1, -1, -1, NULL, D_ALWAYSTOP);
  846.                     return TRUE;
  847.  
  848.                 case NK_F7:
  849.                     if (!WFindWindow(DIALOG6))
  850.                         WCreateWindow(W_TIMER | W_DIALOGMINI, 0, NAME|CLOSER|MOVER|FULLER, "Timer dialog", NULL,
  851.                                         DIALOG6, 0, MENU3,
  852.                                         Window2Dispatcher,
  853.                                         &wind2parms,
  854.                                         -1, -1, -1, -1, NULL, D_NONE);
  855.                     return TRUE;
  856.             }
  857.     }
  858.  
  859.     return FALSE;
  860. }
  861.  
  862.  
  863. int EtcDispatcher(int msg_buf[])
  864. {
  865.     switch (msg_buf[0]) {
  866.         case MN_SELECTED:
  867.             switch(msg_buf[4]) {
  868.                 case 6:
  869.                     WUseInternalAccs(FALSE);
  870.                     WMenuBar(menubar, 1);
  871.                     return FALSE;
  872.                     
  873.                 case ABOUT1:
  874.                     if (!WFindWindow(ABOUTME))
  875.                         WCreateWindow(W_DIALOGICON | W_UNUNTOPPABLE, 0, NAME|MOVER|INFO|FULLER, "About me...", " Copyright \275 1992 - 1994",
  876.                                         ABOUTME, 0, -1,
  877.                                         AboutDispatcher,
  878.                                         0,
  879.                                         -1, -1, -1, -1, NULL, D_SWITCHABLE);
  880.                     return FALSE;
  881.  
  882.                 case QUIT:
  883.                     WDie(0);
  884.                     return FALSE;
  885.  
  886.                 default:
  887.                     if (msg_buf[5] == 10)
  888.                         switch(msg_buf[6]) {
  889.                             case D1:
  890.                                 WCreateWindow(W_DIALOGICON, S_MULTICOPYABLE, NAME|CLOSER|MOVER|FULLER, "Dialog 1", NULL,
  891.                                             DIALOG1, EDITABLE1, MENU2,
  892.                                             Dlg1Dispatcher,
  893.                                             0,
  894.                                             10, -1, -1, -1, NULL, D_NONE);
  895.                                 return FALSE;
  896.  
  897.                             case D2:
  898.                                 if (!WFindWindow(DIALOG2))
  899.                                     WCreateWindow(W_DIALOGICON, 0, NAME|CLOSER|MOVER|FULLER, "Dialog 2", NULL,
  900.                                                 DIALOG2, EDITME, MENU2,
  901.                                                 Dlg2Dispatcher,
  902.                                                 0,
  903.                                                 -1, -1, -1, -1, NULL, D_NONE);
  904.                                 return FALSE;
  905.  
  906.                             case D3:
  907.                                 if (!WFindWindow(DIALOG3))
  908.                                     WCreateWindow(W_DIALOGICON, 0, NAME|CLOSER|MOVER|FULLER, "Dialog 3", NULL,
  909.                                                 DIALOG3, 0, MENU2,
  910.                                                 Dlg3Dispatcher,
  911.                                                 0,
  912.                                                 -1, -1, -1, -1, NULL, D_NONE);
  913.                                 return FALSE;
  914.  
  915.                             case D4:
  916.                                 if (!WFindWindow(DIALOG4))
  917.                                     WCreateWindow(W_DIALOGICON, 0, NAME|CLOSER|MOVER|FULLER, "Dialog 4", NULL,
  918.                                                 DIALOG4, 0, MENU2,
  919.                                                 Dlg4Dispatcher,
  920.                                                 0,
  921.                                                 -1, -1, -1, -1, NULL, D_NONE);
  922.                                 return FALSE;
  923.  
  924.                             case D5:
  925.                                 if (!WFindWindow(DIALOG5))
  926.                                     WCreateWindow(W_ALERT, 0, NAME|CLOSER|MOVER, "Help window", NULL,
  927.                                                 DIALOG5, 0, -1,
  928.                                                 Dlg6Dispatcher,
  929.                                                 0,
  930.                                                 -1, -1, -1, -1, NULL, D_ALWAYSTOP);
  931.                                 return FALSE;
  932.  
  933.                             case W1:
  934.                                 WCreateWindow(W_TIMER | W_OPEN | W_FULLERICONIFIES, 0, NAME|CLOSER|SIZER|MOVER|FULLER, "Window 1", NULL,
  935.                                             -1, 0, MENU3,
  936.                                             WindowDispatcher,
  937.                                             &wind1parms,
  938.                                             10, 20, 200, 40, NULL, D_NONE);
  939.                                 return FALSE;
  940.  
  941.                             case W2:
  942.                                 if (!WFindWindow(DIALOG6))
  943.                                     WCreateWindow(W_TIMER | W_DIALOGMINI, 0, NAME|CLOSER|MOVER|FULLER, "Timer dialog", NULL,
  944.                                                 DIALOG6, 0, MENU3,
  945.                                                 Window2Dispatcher,
  946.                                                 &wind2parms,
  947.                                                 -1, -1, -1, -1, NULL, D_NONE);
  948.                                 return FALSE;
  949.  
  950.                             case RSI1:
  951.                                 if (!WFindWindow(RSCINFO))
  952.                                     WCreateWindow(W_DIALOGICON | W_UNUNTOPPABLE, 0, NAME|MOVER|FULLER, "Resource info...", NULL,
  953.                                                 RSCINFO, 0, -1,
  954.                                                 ResourceDispatcher,
  955.                                                 0,
  956.                                                 -1, -1, -1, -1, NULL, D_SWITCHABLE);
  957.                                 return FALSE;
  958.                         }
  959.  
  960.                     if (msg_buf[5] == 11)
  961.                         switch(msg_buf[6]) {
  962.                             case HELP1:
  963.                                 WFormCustAlert(1, " Hypertext ",
  964.                                     "Sorry, the hypertext section",
  965.                                     "of WinLIB PRO is yet to be",
  966.                                     "re-designed, therefore it is",
  967.                                     "currently disabled.  Wait",
  968.                                     "for the next release.", " ", "[Okay", " ");
  969.                                 return FALSE;
  970.  
  971.                             case HELP2:
  972.                                 WCreateWindow(W_TEXTWIN, 0, W_TEXT_ATTRIBUTES, "WinLIB PRO Version Info", NULL,
  973.                                             -1, 0, -1,
  974.                                             TextDispatcher, 0,
  975.                                             30, 50, 150, 100, NULL, D_SWITCHABLE);
  976.                                 return FALSE;
  977.                         }
  978.  
  979.                     if (msg_buf[5] == 12) {
  980.                         switch(msg_buf[6]) {
  981.                             case HELPFILE:
  982.                             case TEXTFILE:
  983.                             case DESKFILE:
  984.                             case SETFILE:
  985.                                 WFormCustAlert(1, " Load/Save ",
  986.                                     "Sorry, loading and saving of",
  987.                                     "any and all functions of",
  988.                                     "WinLIB PRO are disabled at",
  989.                                     "this time.  Wait for the",
  990.                                     "next release.", " ", "[Okay", " ");
  991.                                 break;
  992.                         }
  993.                         return FALSE;
  994.                     }
  995.  
  996.                     if (msg_buf[5] == 13) {
  997.                         switch(msg_buf[6]) {
  998.                             case CLWIN:
  999.                                 WCloseWindow(NULL, WC_OBJECTABLE);
  1000.                                 return FALSE;
  1001.  
  1002.                             case NXWIN:
  1003.                                 WTopWindow(NULL);
  1004.                                 return FALSE;
  1005.                         }
  1006.                     }
  1007.  
  1008.                     if (msg_buf[5] == 14) {
  1009.                         switch(msg_buf[6]) {
  1010.                             case DA1:
  1011.                             case DA2:
  1012.                             case DA3:
  1013.                             case DA4:
  1014.                             case DA5:
  1015.                             case DA6:
  1016.                                 if (AES_VERSION<0x0400) {
  1017.                                     WMenuBar(menubar, FALSE);
  1018.                                     WUseInternalAccs(TRUE);
  1019.                                 } else
  1020.                                     WCallAccessory(msg_buf[6] - DA1);
  1021.  
  1022.                                 return FALSE;
  1023.                         }
  1024.                     }
  1025.                     return FALSE;
  1026.             }
  1027.     }
  1028.  
  1029.     return FALSE;
  1030. }
  1031.  
  1032. int main()
  1033. {
  1034.     int gl_hchar, gl_wchar, gl_hbox, gl_wbox;
  1035.     int a, b, c, d, e, i;
  1036.  
  1037.     static int work_in[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2};
  1038.     static int work_out[57];
  1039.  
  1040.     ap_id = appl_init();
  1041.  
  1042.     work_in[0] = handle = graf_handle(&gl_wchar, &gl_hchar, &gl_wbox, &gl_hbox);
  1043.     v_opnvwk(work_in, &handle, work_out);
  1044.     WInit(ap_id, work_out, 0, EtcDispatcher, KeyDispatcher, "  WinLIB Pro 0.58", "WLIBTEST", TRUE);
  1045.  
  1046.     AEShandle = handle;
  1047.  
  1048.     WHotkeyLevel(HOTKEY_UNDERLINE);
  1049.  
  1050.     if (xrsrc_load(RSCFILE)) {
  1051.         OBJECT *pup, *ps;
  1052.         LOCAL long *dummy;
  1053.  
  1054.         rsrc_gaddr(R_TREE, MENU1, &menubar);
  1055.         rsrc_gaddr(R_TREE, POPUP, &pup);
  1056.         rsrc_gaddr(R_TREE, PROCSEL, &ps);
  1057.  
  1058.         WMenuAttach(menubar, WINDS, DIALSEL, TRUE);
  1059.  
  1060. /*        get_cookie('WPRO', dummy);
  1061.  
  1062.         if (dummy == 0)
  1063.             WFormCustAlert(1, " WinLIB Cookie ",
  1064.                         "Hmmm..  The WinLIB Pro cookie",
  1065.                         "was not found in the cookie-",
  1066.                         "jar.  Assuming all program",
  1067.                         "defaults.  Please run COOKIE",
  1068.                         "INSTALL at boot-time.", " ", "[Okay", " "); */
  1069.  
  1070.         if (desk_accessories[1])
  1071.             ChangeObjectText(ps, DA1, desk_accessories[1], 3, TE_LEFT);
  1072.         if (desk_accessories[2])
  1073.             ChangeObjectText(ps, DA2, desk_accessories[2], 3, TE_LEFT);
  1074.         if (desk_accessories[3])
  1075.             ChangeObjectText(ps, DA3, desk_accessories[3], 3, TE_LEFT);
  1076.         if (desk_accessories[4])
  1077.             ChangeObjectText(ps, DA4, desk_accessories[4], 3, TE_LEFT);
  1078.         if (desk_accessories[5])
  1079.             ChangeObjectText(ps, DA5, desk_accessories[5], 3, TE_LEFT);
  1080.         if (desk_accessories[6])
  1081.             ChangeObjectText(ps, DA6, desk_accessories[6], 3, TE_LEFT);
  1082.  
  1083.         WMenuBar(menubar, 1);
  1084.         if (num_colors<=4) {
  1085.             pup[PBLUE].ob_state = DISABLED;
  1086.             pup[PCYAN].ob_state = DISABLED;
  1087.             pup[PYELLOW].ob_state = DISABLED;
  1088.             pup[PMAGENTA].ob_state = DISABLED;
  1089.  
  1090.             pup[PUBLUE].ob_state = DISABLED;
  1091.             pup[PUCYAN].ob_state = DISABLED;
  1092.             pup[PUYELLOW].ob_state = DISABLED;
  1093.             pup[PUMAGENT].ob_state = DISABLED;
  1094.         }
  1095.  
  1096.         if (num_colors == 2) {
  1097.             pup[PRED].ob_state = DISABLED;
  1098.             pup[PGREEN].ob_state = DISABLED;
  1099.             pup[PBLUE].ob_state = DISABLED;
  1100.             pup[PCYAN].ob_state = DISABLED;
  1101.             pup[PYELLOW].ob_state = DISABLED;
  1102.             pup[PMAGENTA].ob_state = DISABLED;
  1103.  
  1104.             pup[PURED].ob_state = DISABLED;
  1105.             pup[PUGREEN].ob_state = DISABLED;
  1106.             pup[PUBLUE].ob_state = DISABLED;
  1107.             pup[PUCYAN].ob_state = DISABLED;
  1108.             pup[PUYELLOW].ob_state = DISABLED;
  1109.             pup[PUMAGENT].ob_state = DISABLED;
  1110.         }
  1111.  
  1112.         WGrafMouse(ARROW);
  1113.  
  1114.         if (!WCheckSpeedup())
  1115.             form_alert(1,"[2][Uh oh...  No screen speed-|"
  1116.                              "up utilities were detected.|"
  1117.                              "Graphics routines may be a|"
  1118.                              "bit on the slow side.][ Okay ]");
  1119.  
  1120.         WFormCustAlert(1, " WinLIB PRO ",
  1121.                     "New version (0.64A)",
  1122.                     "This version compiled on",
  1123.                     __DATE__" at "__TIME__,
  1124.                     __DEMO__,
  1125.                     "Unregistered demo copy", " ", "[Okay", " ");
  1126.  
  1127. /*        WCreateWindow(W_DIALOGICON, 0, NAME|CLOSER|MOVER|FULLER, "Toolbar", NULL,
  1128.                         TOOLBOX, 0, -1,
  1129.                         ToolDispatcher,
  1130.                         0,
  1131.                         0, desk.g_y, -1, -1, NULL, D_NONE); */
  1132.  
  1133.         WDoDial(menubar);
  1134.  
  1135.         WMenuAttach(menubar, WINDS, DIALSEL, FALSE);
  1136.  
  1137.         WMenuBar(menubar, 0);
  1138.         Rsrc_Free();
  1139.     }
  1140.     else
  1141.         WFormCustAlert(1, " Resource file??? ",
  1142.                           "The resource file could not",
  1143.                           "be located.  Please move the",
  1144.                           "program's resource to the",
  1145.                           "root directory, and try",
  1146.                           "booting again.", " ", "[Okay", " ");
  1147.  
  1148.     WTerm();
  1149.     v_clsvwk(handle);
  1150.     appl_exit();
  1151.  
  1152.     return 0;
  1153. }